
package com.b2mining.integration.mail;

import java.util.Vector;
import org.apache.log4j.Logger;
//import com.b2mining.integration.helper.Helper;

/**
 * Clase 
 * @since 27/07/2007
 * @author adminebiz <BR>
 * Analista Programador: Richard Linares
 */
public class MailAttributes
{
	Logger log = Logger.getLogger(this.getClass());
   private java.lang.String subject;
   private java.lang.String[] to;
   private java.util.Vector para;
   private java.lang.String from;
   private java.lang.String message;
   
   public int getCountPara(){
	   return para.size();
   }
   
	
   
   public MailAttributes(){
	   para = new Vector();
   }
   
   public void add(Destinatario dest){
	   para.add(dest);
   }
   
   public Destinatario getDestinatario(int i){
	   Destinatario dest=null;
	   try{
		   dest = (Destinatario) para.get(i);
	   }
	   catch(NullPointerException npe){
		   System.out.println("Destinatario nulo");
	   }
	   return dest;
   }
   
   public void remove(int i){
	   try{
		   para.remove(i);
	   }
	   catch(NullPointerException npe){
		   System.out.println("Destinatario nulo");
	   }
   }
   
   /**
	 * Returns the from.
	 * @return java.lang.String
	 */
	public java.lang.String getFrom() {
		return from;
	}
	
	/**
	 * Returns the message.
	 * @return java.lang.String
	 */
	public java.lang.String getMessage() {
		return message;
	}
	
	/**
	 * Returns the subject.
	 * @return java.lang.String
	 */
	public java.lang.String getSubject() {
		return subject;
	}
	
	/**
	 * Returns the to.
	 * @return java.lang.String[]
	 */
	public java.lang.String[] getTo() {
		return to;
	}
	
	/**
	 * Sets the from.
	 * @param from The from to set
	 */
	public void setFrom(java.lang.String from) {
		this.from = from;
	}
	
	/**
	 * Sets the message.
	 * @param message The message to set
	 */
	public void setMessage(java.lang.String message) {
		this.message = message;
	}
	
	/**
	 * Sets the subject.
	 * @param subject The subject to set
	 */
	public void setSubject(java.lang.String subject) {
		this.subject = subject;
	}
	
	/**
	 * Sets the to.
	 * @param to The to to set
	 */
	public void setTo(java.lang.String[] to) {
		this.to = to;
	}

	public java.util.Vector getPara() {
		return para;
	}

	public void setPara(java.util.Vector para) {
		if(para!=null){
			for(int j=0; j<para.size();j++){
				Destinatario m = (Destinatario)para.get(j);
				log.debug("Set Para: Nombre "+m.getNombre()+" correo "+m.getCorreo());
			}
		}
		this.para = para;
	}

}